/*
	Prototype is developed by Benato Denis.
	Prototype is a project started on 23/09/2013.
	Prototype is release under LGPLv3 license.
	If you use part of Prototype software on other
	projects, you must copy this comment into the source
	code of the other projects, and quote Benato Denis 
	in the credits of the other software.
*/

#ifndef __MEMORY_H__
#define __MEMORY_H__

#include "Prototype.h"
#include "Stack.h"

struct Data
{
	unsigned char DataOnByte;
	struct Data* Next;
	struct Data* Previous;
};

struct DataSequence
{
	struct Data* Byte;
	struct DataSequence* Next;
	struct DataSequence* Previous;
};

void ResetEveryByte(struct Data* bytes);
void DeleteEveryByte(struct Data* bytes);

class Memory
{
	public:
		void Reset();
		void GotoNextByteList();
		void GotoPreviousByteList();
		void GotoNextByte();
		void GotoPreviousByte();
		void POP();
		void PUSH();
		void SetByte(unsigned char);
		unsigned char GetByte();
		Memory();
		~Memory();
		
	private:
		struct DataSequence* CurrentData;
		Stack* ProgramStack;
};

#endif
